package com.itmumu.miniwechat.user.domain.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * 联系人申请表
 * @TableName user_contact_apply
 */
@TableName(value ="user_contact_apply")
@Data
public class UserContactApply implements Serializable {
    /**
     * 
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 申请人用户ID
     */
    private Integer applyUid;

    /**
     * 申请描述
     */
    private String applyDescription;

    /**
     * 接收人ID
     */
    private Integer receiveUid;

    /**
     * 接收人描述
     */
    private String receiveDescription;

    /**
     * 联系人类型：1=好友，2=群组
     */
    private Integer contactType;

    /**
     * 联系人ID或群组ID
     */
    private Integer contactId;

    /**
     * 添加来源
     */
    private Integer source;

    /**
     * 申请状态：0=待处理，1=已添加
     */
    private Integer status;

    /**
     * 删除人
     */
    private Integer deletedBy;

    /**
     * 申请时间
     */
    private Long applyTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserContactApply other = (UserContactApply) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getApplyUid() == null ? other.getApplyUid() == null : this.getApplyUid().equals(other.getApplyUid()))
            && (this.getApplyDescription() == null ? other.getApplyDescription() == null : this.getApplyDescription().equals(other.getApplyDescription()))
            && (this.getReceiveUid() == null ? other.getReceiveUid() == null : this.getReceiveUid().equals(other.getReceiveUid()))
            && (this.getContactType() == null ? other.getContactType() == null : this.getContactType().equals(other.getContactType()))
            && (this.getContactId() == null ? other.getContactId() == null : this.getContactId().equals(other.getContactId()))
            && (this.getSource() == null ? other.getSource() == null : this.getSource().equals(other.getSource()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getApplyTime() == null ? other.getApplyTime() == null : this.getApplyTime().equals(other.getApplyTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getApplyUid() == null) ? 0 : getApplyUid().hashCode());
        result = prime * result + ((getApplyDescription() == null) ? 0 : getApplyDescription().hashCode());
        result = prime * result + ((getReceiveUid() == null) ? 0 : getReceiveUid().hashCode());
        result = prime * result + ((getContactType() == null) ? 0 : getContactType().hashCode());
        result = prime * result + ((getContactId() == null) ? 0 : getContactId().hashCode());
        result = prime * result + ((getSource() == null) ? 0 : getSource().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getApplyTime() == null) ? 0 : getApplyTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", applyUid=").append(applyUid);
        sb.append(", applyDescription=").append(applyDescription);
        sb.append(", receiveUid=").append(receiveUid);
        sb.append(", contactType=").append(contactType);
        sb.append(", contactId=").append(contactId);
        sb.append(", source=").append(source);
        sb.append(", status=").append(status);
        sb.append(", applyTime=").append(applyTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}